package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: HuangQi
 * @date: Created in 20:48 2023/8/29
 * @description: 订单明细数据层接口(Mapper)
 */
@Mapper
public interface OrderDetailMapper {

    /**
     * 新增订单明细
     *
     * @param orderDetail
     */
    void insertBatch(List<OrderDetail> orderDetails);

    /**
     * 根据订单id查询订单明细
     *
     * @param orderId
     * @return
     */
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);
}
